package com.zb.mapper;

import com.zb.pojo.User;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Select;

public interface UserMapper {

//    用户注册
    @Insert("insert into tb_user values(null,#{userName},#{passWord},#{phone},#{addr})")
//    @ResultMap("userResultMap")
    void registerUser(User user);

//    用户登录
    @Select("select * from tb_user where username = #{userName} and password=#{passWord}")
    User loginUser(@Param("userName") String u,@Param("passWord") String p);

    @Select("select * from tb_user where username = #{userName} and password=#{passWord}")
    @ResultMap("userResultMap")
    User loginUser222(User user);


    //    @Select("select * from tb_user where username = #{username}")
//    User selectByUsername(String username);
}
